//
//  OCRReadCardViewController.m
//  HappyBug
//
//  Created by liulei on 2018/12/20.
//  Copyright © 2018年 www.hc.com.cn. All rights reserved.
//

#import "OCRReadCardViewController.h"
#import "ICBCBankCardOCR.h"

@interface OCRReadCardViewController ()<ICBCBankCardDelegate>

@end

@implementation OCRReadCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *button=[[UIButton alloc] initWithFrame:CGRectMake(50, 100, 200, 200)];
    [button setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [button setTitle:@"test" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:button];
   
}

-(void)test
{
    ICBCBankCardOCR *bankCard=[[ICBCBankCardOCR alloc] init];
    bankCard.delegate=self;
    bankCard.isHidePhotoButton = YES;
    self.navigationController.navigationBarHidden=YES;
    [self.navigationController pushViewController:bankCard animated:YES];
}
//银行卡识别核心初始化结果，判断核心是否初始化成功
- (void)initBankCardRecWithResult:(int)nInit
{
    if(nInit==0)
        NSLog(@"初始化成功！");
}

//拍照和识别成功后返回结果图片、识别结果
-(void)cameraViewController:(ICBCBankCardOCR *)cameraVC resultImage:(UIImage *)image resultDictionary:(NSDictionary *)resultDic
{
    NSLog(@"结果集 :%@",resultDic);
}

- (void)getFullResultImage:(UIImage *)image {
    NSLog(@"%@", image);
}

//返回按钮被点击时回调此方法，返回相机视图控制器
- (void)backWithCameraViewController:(ICBCBankCardOCR *)cameraVC
{
    [cameraVC.navigationController popViewControllerAnimated:YES];
}

//点击UIAlertView时返回相机视图控制器
- (void)clickAlertViewWithCameraViewController:(ICBCBankCardOCR *)cameraVC
{
    
}

@end
